<div id="city-flow-bar3" style=" height: 100%">

</div>
<script type="text/javascript">
    $(function () {
        loadweekorderbar1();
        $("select#prjId").change(function(){
            loadweekorderbar1();
        });
    })
    function loadweekorderbar1() {
        var hospital=$("#prjId").val();
        $.ajax({
            url: "#springUrl('/network/city/weekorder/bar1')",
            data: {"batchId": "$!{batchId}","hospital":hospital},
            type: "POST",
            success: function (text) {
                var d = JSON.parse(text);
                if (d.success && d.data) {
                    var myChart = echarts.init(document.getElementById('city-flow-bar3'), 'macarons');
                    var option = {
                        grid: {
                            left: '3%',
                            right: '3%',
                            bottom: '15%',
                            top:'5%',
                            containLabel: true
                        },
                        title: {
                            text: '',
                            show: false
                        },
                        tooltip: {
                            trigger: 'axis',
                            axisPointer: {
                                type: 'cross',
                                label: {
                                    backgroundColor: '#283b56'
                                }
                            }
                        },
                        toolbox: {
                        },
                        dataZoom: {
                            show: false,
                            start: 0,
                            end: 100
                        },
                        legend: {

                        },
                        calculable: true,
                        xAxis: [
                            {
                                type: 'category',
                                data: d.data.x,
                                boundaryGap: true,
                                axisLabel:{
                                    show:true,
                                    textStyle:{
                                        color:"#595959"
                                    }
                                },
                                axisLine: {
                                    show: false
                                },
                                axisTick: {
                                    show: false
                                },
                            }

                        ],
                        yAxis: [
                            {
                                type: 'value',
                                axisLine: {
                                    show: false
                                },
                                axisTick: {
                                    show: false
                                },
                                axisLabel: {
                                    formatter: function(value){
                                        var var1=value*1;
                                        return var1;
                                    },
                                    textStyle:{
                                        color:"#595959"
                                    }
                                },
                                splitLine:{
                                    show:true
                                },
                                splitArea: {
                                    show: true,
                                    areaStyle: {
                                        color: ['rgba(0,0,0,0)', 'rgba(0,0,0,0)']
                                    }
                                },
                            },

                        ],
                        series: [
                            {
                                name: '业务量量柱状图',
                                type: 'bar',
                                data:  d.data.s1,
                                barWidth:30,
                                itemStyle: {
                                    normal: {
                                        //好，这里就是重头戏了，定义一个list，然后根据所以取得不同的值，这样就实现了，
                                        color:  '#0fa99d'
                                        //以下为是否显示，显示位置和显示格式的设置了
                                    }}
                            },

                        ]
                    };
                    myChart.setOption(option);
                }
            },
            error:function (text) {
                var div1="<div type='text' style='padding-top:15%' class=' text-center  '>查询数据异常</div>";
                $("#bar3").empty();
                $("#bar3").prepend(div1);
            }
        })
    }
</script>
